# author ： 以凝
# time   ： 2024/3/18  14:25



from PyQt5.QtWidgets import *
from libs.utils.icon import new_icon


def new_button(text, icon=None, slot=None):
    b = QPushButton(text)
    if icon is not None:
        b.setIcon(new_icon(icon))
    if slot is not None:
        b.clicked.connect(slot)
    return b